#include "global.h"
#include "game_app.h"
#include "scene_manager.h"
#include "logic_manager.h"
#include <Windows.h>

game_app::game_app()
{

}

game_app::~game_app()
{

}

//initialize
void game_app::init_hge_state()
{
	hge->System_SetState(HGE_FRAMEFUNC, logic_manager::get_instance()->logic_update);
	hge->System_SetState(HGE_RENDERFUNC, scene_manager::get_instance()->scene_render);
	hge->System_SetState(HGE_TITLE, "one simple game (demo 2.0) - 107485739@qq.com");
	hge->System_SetState(HGE_WINDOWED, true);
	hge->System_SetState(HGE_SCREENBPP, 32);
	hge->System_SetState(HGE_FPS, 100);
	hge->System_SetState(HGE_HIDEMOUSE, false);
	hge->System_SetState(HGE_USESOUND, true);
	hge->System_SetState(HGE_SHOWSPLASH, false);
}

//start game
int game_app::run()
{
	init_hge_state();

	if(hge->System_Initiate())
	{
		hge->System_Start();
	}

	return 0;
}
